<div class="contents">
  <ol class="breadcrumb" ng-if="false">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/pevcproduct/list?t=06">产品列表</a></li>
    <li class="active">产品详情</li>
  </ol>
  <table class="table table-striped table-bordered">
    <tbody> 
    <tr> <td width="100"> 产品简称</td> <td >{{project.pName }}</td> </tr>
      <tr> <td>产品全名</td> <td >{{project.pFullName }}</td> </tr>
      <tr> <td>发行机构</td> <td > {{project.pInvestOwner}} </td> </tr>
      <tr> <td>管理机构</td> <td > {{project.projectExpandDTO.peManageOrg}} </td> </tr>
      <tr> <td>发行地区</td> <td >{{project.pPublicArea | publicAreaRender}}</td> </tr>
      <tr> <td>发行规模 </td> <td >{{project.pAllIssuingScale | moneyRender}}</td> </tr>
      <tr> <td>组织形式</td> <td > {{project.projectExpandDTO.peOrganizeShape | pevczzxsRender}} </td> </tr>
      <tr> <td>基金类型</td> <td > {{project.projectExpandDTO.peFundShape}} </td> </tr>
      <tr> <td>起售时间</td> <td >{{project.pSaleTimeStart | date:'yyyy年MM月dd日'}}</td> </tr>
      <tr> <td>起购金额</td> <td >{{project.pMinimumAmount | moneyRender}}</td> </tr>
      <tr> <td>累进追加金额最小值</td> <td >{{project.pProgressiveAmount | moneyRender}}</td> </tr>
      <tr> <td>认购费</td> <td >{{project.projectExpandDTO.peSubscriptionFee }}</td> </tr>
      <tr> <td>管理费</td> <td > {{project.projectExpandDTO.peManagementExpense}} </td> </tr>
      <tr> <td>收益分成</td> <td > {{project.projectExpandDTO.peRevenueSharing}} </td> </tr>
      <tr> <td>产品期限</td> <td >{{project.pDueTime | dueTimeRender }}</td> </tr>
      <tr> <td>产品期限说明</td> <td >{{project.pDueTimeDes }}</td> </tr>
      <tr> <td>产品成立时间</td> <td >{{project.pEstablishmentTime  | date:'yyyy年MM月dd日' }}</td> </tr>
      <tr> <td>项目期限是否提前结束</td> <td >{{project.pEndEarlyIdentification | pEndEarlyIdentificationRender}}</td> </tr>
      <tr> <td>提交资料</td> <td >{{project.tjzls| tjzlStatus}}</td> </tr>
      <tr> <td>产品供应方公司</td> <td >{{project.pAccessCompany}}</td> </tr>
      <tr> <td>对接人</td> <td >{{project.pAccessName|hiddenFirst}}</td> </tr>
      <tr> <td>发布状态</td> <td >{{project.pPublicStatus | productPublicStatusRender}}</td> </tr>
      <tr> <td>发布中间状态</td> <td >{{project.status | productStatusRender}}</td> </tr>
      <tr> <td>募集进度</td> <td >{{((project.pAllSubscriptionAmount / project.pIssuingScale) || 0) * 100 | number:2}}%</td> </tr> 
      <tr> <td>募集进度说明</td> <td >{{project.pRecruitmentSummary}}</td> </tr> 
<!--
      <tr> <td>产品类型</td> <td >{{project.pType | productTypeRender}}</td> </tr>
      <tr> <td>销售状态</td> <td >{{project.pSaleStatus | productSaleStatusRender}}</td> </tr>
      <tr> <td>预期销售金额</td> <td >{{project.pExpectSubscriptionAmount | moneyRender}}</td> </tr> 
      <tr> <td>实际销售金额</td> <td >{{project.pRealSubscriptionAmount | moneyRender}}</td> </tr>
      <tr> <td>实际销售份额</td> <td >{{project.pRealSubscriptionShare | moneyRender}}</td> </tr>
      <tr> <td>投资领域</td> <td >{{project.pInvestType | investTypeRender}}</td> </tr>
      <tr> <td>项目所属</td> <td > {{project.pProjectOwner}} </td> </tr>
      <tr> <td>产品成立时间</td> <td >{{project.pEstablishmentTime | date:'yyyy年MM月dd日'}}</td> </tr>
      
      <tr> <td>付息方式</td> <td >{{project.pPaymentInterestType | paymentInterestTypeRender}}</td> </tr>
      <tr> <td>大小配比类型</td> <td >{{project.pSizeRatioType | pSizeRatioTypeRender}}</td> </tr>
      <tr> <td>大小配比说明</td> <td >{{project.pSizeRatioExplain}}</td> </tr>
       -->
      <tr> <td>收益及返佣</td> <td >
        <table class="table table-striped table-hover ">
          <thead>
            <tr>
              <th width="90">起始金额</th>
              <th width="90">结束金额</th>
              <th width="100">预期年化率</th>
              <th width="80" has-auth where="btn" who="PRODUCT_EDIT" owner="{{project.createBy}}">核心价</th>
              <th width="80">成本价</th>
              <th width="80">机构价</th>
              <th width="130">返佣率(挂网价)</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="revenue in projectAnnualRevenue">
              <td>{{revenue.pStartAmount | moneyRender}}</td>
              <td>{{revenue.pEndAmount | moneyRender}}</td>
              <td>{{revenue.pAnnualRevenueExpect | profitRender}}</td> 
              <td has-auth where="btn" who="PRODUCT_EDIT" owner="{{project.createBy}}">{{projectRabateList[$index].pCorePrice | profitRender}}</td> 
              <td>{{projectRabateList[$index].pCostPrice | profitRender}}</td> 
              <td>{{projectRabateList[$index].pSellingPrice | profitRender}}</td> 
              <td>{{projectRabateList[$index].pRabateProfit | profitRender}}</td>
            </tr>
          </tbody>
        </table> 
      </td> </tr> 
   
    <tr>
      <td colspan="2">
        <a ng-if="false" class="btn btn-primary" href="#/pevcproduct/edit?id={{project.id}}" has-auth where="btn" who="PRODUCT_EDIT" owner="{{project.createBy}}">编辑</a>
        <a ng-if="false" class="btn btn-primary" href="#/product/saleProcess?id={{project.id}}" has-auth where="btn" who="PRODUCT_UPDATE_SALEPROCESS">销售进度</a>
        <a ng-if="false" class="btn btn-primary" href="#/product/profit?id={{project.id}}" has-auth where="btn" who="PRODUCT_PROFIT_LIST">年化率及返佣</a>
        <a ng-if="false" class="btn btn-primary" href="#/product/attach?id={{project.id}}" has-auth where="btn" who="PRODUCT_ATTACH_LIST">附件管理</a>
        <a class="cur-p btn btn-primary" ng-click="deleteProduct(project.id)" ng-if="isDeleteable(project)" has-auth where="btn" who="PRODUCT_DELETE" owner="{{project.createBy}}">删除</a>
        <a class="cur-p btn btn-primary" ng-click="productPassVerify(project.id)" ng-if="isPassVerifyable(project)" has-auth where="btn" who="PRODUCT_VERIFY" owner="{{project.createBy}}">审核通过</a>
        <a class="cur-p btn btn-primary" ng-click="productPassPublish(project.id)" ng-if="isPassPublishable(project)"  has-auth where="btn" who="PRODUCT_PUBLISH" owner="{{project.createBy}}">发布</a>
        <a class="cur-p btn btn-primary" ng-click="showProductEstablish(project.id)" ng-if="isPassEstablishable(project)"  has-auth where="btn" who="PRODUCT_SET" owner="{{project.createBy}}">产品成立</a>
        <a class="cur-p btn btn-primary" ng-click="stopProduct(project.id,3)" ng-if="isStopable(project)"  has-auth where="btn" who="PRODUCT_PUBLISH" owner="{{project.createBy}}">下架</a>
      </td>
    </tr>
  </tbody>
</table>

<form class="form-horizontal mt-30" role="form" name="form" novalidate ng-submit="save()" style="border:1px solid #ddd;padding:20px;">
  <div class="form-group" ng-class="{'has-error':form.toUserId.$invalid}">
    <label class="col-sm-2 control-label">
      <span class="required">*</span>
      转移产品权限给：
    </label>
    <div class="col-sm-4">
      <select class="form-control" name="toUserId" ng-model="trans.toUserId" ng-options="m.userId as m.username for m in userList" required="required"><option value="">--请选择管理员--</option> </select> 
    </div> 
    <div class="col-sm-2">
      <input type="submit" class="btn btn-primary" value="保存"  has-auth where="btn" who="PRODUCT_TRANS_ADD" owner="{{project.createBy}}"/>
    </div>
  </div>
  <div class="form-group" ng-class="{'has-error':form.pName.$invalid}">
    <label class="col-sm-2 control-label">
      权限转移列表：
    </label>
    <div class="col-sm-4">
      <table class="table table-striped table-hover ">
        <thead>
          <tr>
            <th width="120">转移人</th>
            <th width="120">转移目标</th>
            <th width="150">转移时间</th>
          </tr>
        </thead>
        <tbody>
          <tr ng-repeat="item in transList">
            <td>{{item.formUserName}}</td>
            <td>{{item.toUserName}}</td>
            <td>{{item.transferDate | date:"yy-MM-dd HH:mm:ss"}}</td>
          </tr>
        </tbody>
      </table>
    </div>
  </form>
</div>

<div class="layer-box" ng-show="showEstablishaFormFlag">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px;">
    <span class="icons-close" title="关闭" ng-click="showEstablishaFormFlag = false;">X</span>
    <div class="layer-title">
      请填写成立时间
    </div>
    <div class="con-wrap">
      <form class="form-horizontal" role="form" name="estagForm" novalidate ng-submit="productEstablish()">
        <div class="form-group" ng-class="{'has-error':estagForm.pEstablishmentTimeStr.$invalid}"> 
          <input type="date" class="form-control" value="" ng-model="estabItem.pEstablishmentTimeStr" name="pEstablishmentTimeStr" required="required"/>
        </div> 
        <div class="form-group" >
          <input type="submit" class="btn btn-block btn-primary" value="保存" />
        </div>
      </form>
    </div>
  </div>
</div> 
